<template>
    <el-select
      v-model="tenantId"
      placeholder="请选择店铺"
      clearable
      filterable
      :size="size"
      @change="change"
    >
      <el-option
        v-for="dict in tenantList"
        :key="dict.tenantId"
        :label="dict.tenantName"
        :value="dict.tenantId"
      />
    </el-select>
</template>

<script>
export default {
  name: "selectTenant",
  props:['value','size'],
  data() {
    return {
      tenantId:''
    };
  },
  watch:{
    value:{
      handler(val){
        if(val!=this.tenantId) this.tenantId = val
      },
      immediate:true
    }
  },
  computed: {
    tenantList() {
      return this.$store.getters.tenantList
    }
  },
  created() {
   
  },
  methods: {
    change(e){
      this.$emit('change',e)
    }
  }
};
</script>
